/**
 * 
 */
package com.boshanam.application.tiles.init.config;

import org.apache.tiles.TilesApplicationContext;
import org.apache.tiles.factory.AbstractTilesContainerFactory;
import org.apache.tiles.startup.AbstractTilesInitializer;
import org.apache.tiles.startup.TilesInitializer;
import org.apache.tiles.web.startup.AbstractTilesListener;

/**
 * Loads all Tiles definition files which are starting with tiles and ends with .xml
 * Lookup the "WEB-IND/defs/" directory.
 * 
 * @author Swetha
 *
 */
public class AutoDefinitionFinderTilesListener extends AbstractTilesListener {

    @Override
    protected TilesInitializer createTilesInitializer() {
        return new AutoFindTilesListenerInitializer();
    }

    private static class AutoFindTilesListenerInitializer extends AbstractTilesInitializer {

        @Override
        protected AbstractTilesContainerFactory createContainerFactory(
                TilesApplicationContext context) {
            return new AutoFindTilesContainerFactory();
        }
    }

}
